cd /d %~dp0
set url=%1
echo url:%url%
set name=checkbyurl-%random%
echo %name%
wget  --max-redirect=0 -S -O %name%.out -o %name%.log  %url%
set wget_code=%ERRORLEVEL%
cat %name%.log| grep -Po "^\s+HTTP/1.\d\s+\d{3}\s+$" |  grep -Po "\d{3}" >%name%.code
set code=
set /p code=<%name%.code
if not defined code set code=%wget_code%
echo code:%code%
del %name%.*


